{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": "1"
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "D:\\Anaconda3\\lib\\site-packages\\tensorflow\\python\\framework\\dtypes.py:526: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n",
      "  _np_qint8 = np.dtype([(\"qint8\", np.int8, 1)])\n",
      "D:\\Anaconda3\\lib\\site-packages\\tensorflow\\python\\framework\\dtypes.py:527: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n",
      "  _np_quint8 = np.dtype([(\"quint8\", np.uint8, 1)])\n",
      "D:\\Anaconda3\\lib\\site-packages\\tensorflow\\python\\framework\\dtypes.py:528: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n",
      "  _np_qint16 = np.dtype([(\"qint16\", np.int16, 1)])\n",
      "D:\\Anaconda3\\lib\\site-packages\\tensorflow\\python\\framework\\dtypes.py:529: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n",
      "  _np_quint16 = np.dtype([(\"quint16\", np.uint16, 1)])\n",
      "D:\\Anaconda3\\lib\\site-packages\\tensorflow\\python\\framework\\dtypes.py:530: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n",
      "  _np_qint32 = np.dtype([(\"qint32\", np.int32, 1)])\n",
      "D:\\Anaconda3\\lib\\site-packages\\tensorflow\\python\\framework\\dtypes.py:535: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n",
      "  np_resource = np.dtype([(\"resource\", np.ubyte, 1)])\n"
     ]
    }
   ],
   "source": [
    "import tensorflow as tf"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "outputs": [
    {
     "data": {
      "text/plain": "<tf.Tensor 'concat_3:0' shape=(1, 4, 4, 2) dtype=float32>"
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "img = tf.constant(value=[[[[1],[2],[3],[4]],[[1],[2],[3],[4]],[[1],[2],[3],[4]],[[1],[2],[3],[4]]]],dtype=tf.float32)\n",
    "img = tf.concat(values=[img,img],axis=3)\n",
    "img"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "结果是： [[[[1. 1.]\n",
      "   [2. 2.]\n",
      "   [3. 3.]\n",
      "   [4. 4.]]\n",
      "\n",
      "  [[1. 1.]\n",
      "   [2. 2.]\n",
      "   [3. 3.]\n",
      "   [4. 4.]]\n",
      "\n",
      "  [[1. 1.]\n",
      "   [2. 2.]\n",
      "   [3. 3.]\n",
      "   [4. 4.]]\n",
      "\n",
      "  [[1. 1.]\n",
      "   [2. 2.]\n",
      "   [3. 3.]\n",
      "   [4. 4.]]]]\n"
     ]
    }
   ],
   "source": [
    "sess=tf.Session()\n",
    "with sess.as_default():\n",
    "    print('结果是：', img.eval())"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "outputs": [],
   "source": [
    "filter = tf.constant(value=1, shape=[3,3,2,5], dtype=tf.float32)\n",
    "out_img1 = tf.nn.atrous_conv2d(value=img, filters=filter, rate=1, padding='SAME')"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[[[12. 12. 12. 12. 12.]\n",
      "   [24. 24. 24. 24. 24.]\n",
      "   [36. 36. 36. 36. 36.]\n",
      "   [28. 28. 28. 28. 28.]]\n",
      "\n",
      "  [[18. 18. 18. 18. 18.]\n",
      "   [36. 36. 36. 36. 36.]\n",
      "   [54. 54. 54. 54. 54.]\n",
      "   [42. 42. 42. 42. 42.]]\n",
      "\n",
      "  [[18. 18. 18. 18. 18.]\n",
      "   [36. 36. 36. 36. 36.]\n",
      "   [54. 54. 54. 54. 54.]\n",
      "   [42. 42. 42. 42. 42.]]\n",
      "\n",
      "  [[12. 12. 12. 12. 12.]\n",
      "   [24. 24. 24. 24. 24.]\n",
      "   [36. 36. 36. 36. 36.]\n",
      "   [28. 28. 28. 28. 28.]]]]\n"
     ]
    }
   ],
   "source": [
    "sess=tf.Session()\n",
    "with sess.as_default():\n",
    "    print(out_img1.eval())"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "outputs": [
    {
     "data": {
      "text/plain": "<tf.Tensor 'convolution_2:0' shape=(1, 2, 2, 5) dtype=float32>"
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "out_img2 = tf.nn.atrous_conv2d(value=img, filters=filter, rate=1, padding='VALID')\n",
    "out_img2"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "outputs": [
    {
     "data": {
      "text/plain": "<tf.Tensor 'convolution_3/BatchToSpaceND:0' shape=(1, 4, 4, 5) dtype=float32>"
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "out_img3 = tf.nn.atrous_conv2d(value=img, filters=filter, rate=2, padding='SAME')\n",
    "out_img3"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "结果是： [[[[16. 16. 16. 16. 16.]\n",
      "   [24. 24. 24. 24. 24.]\n",
      "   [16. 16. 16. 16. 16.]\n",
      "   [24. 24. 24. 24. 24.]]\n",
      "\n",
      "  [[16. 16. 16. 16. 16.]\n",
      "   [24. 24. 24. 24. 24.]\n",
      "   [16. 16. 16. 16. 16.]\n",
      "   [24. 24. 24. 24. 24.]]\n",
      "\n",
      "  [[16. 16. 16. 16. 16.]\n",
      "   [24. 24. 24. 24. 24.]\n",
      "   [16. 16. 16. 16. 16.]\n",
      "   [24. 24. 24. 24. 24.]]\n",
      "\n",
      "  [[16. 16. 16. 16. 16.]\n",
      "   [24. 24. 24. 24. 24.]\n",
      "   [16. 16. 16. 16. 16.]\n",
      "   [24. 24. 24. 24. 24.]]]]\n"
     ]
    }
   ],
   "source": [
    "sess=tf.Session()\n",
    "with sess.as_default():\n",
    "    print('结果是：', out_img3.eval())"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "outputs": [],
   "source": [
    "# 填充方式为“VALID”时，返回[batch,height-2*(filter_width-1),width-2*(filter_height-1),out_channels]的Tensor，\n",
    "# 填充方式为“SAME”时，返回[batch, height, width, out_channels]的Tensor\n",
    "\n",
    "out_img4 = tf.nn.atrous_conv2d(value=img, filters=filter, rate=2, padding='VALID')\n",
    "out_img4"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Using TensorFlow backend.\n"
     ]
    }
   ],
   "source": [
    "from keras.layers import Input, Conv2D, BatchNormalization, MaxPooling2D\n",
    "def conv2d(size):\n",
    "    return Conv2D(size, (3, 3), use_bias=True, activation='relu',\n",
    "                  padding='same', kernel_initializer='he_normal')"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "imgMax = np.random.rand(8000,200,1,1)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "outputs": [
    {
     "data": {
      "text/plain": "<tf.Tensor 'Const_24:0' shape=(500, 200, 1, 1) dtype=float64>"
     },
     "execution_count": 49,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "inputTensor = tf.constant(imgMax)\n",
    "inputTensor"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "outputs": [
    {
     "data": {
      "text/plain": "<tf.Tensor 'same_conv_9:0' shape=(500, 200, 1, 1) dtype=float64>"
     },
     "execution_count": 50,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "filter = tf.constant(value=1, shape=[3,3,1,1], dtype=tf.float64)\n",
    "outimg = tf.nn.conv2d(imgMax,filter,[1,1,1,1],'SAME',name='same_conv')\n",
    "outimg"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "结果是： [[[[1.07195283]]\n",
      "\n",
      "  [[1.37104546]]\n",
      "\n",
      "  [[1.93115988]]\n",
      "\n",
      "  ...\n",
      "\n",
      "  [[1.43764426]]\n",
      "\n",
      "  [[1.39740811]]\n",
      "\n",
      "  [[0.69339028]]]\n",
      "\n",
      "\n",
      " [[[0.48634001]]\n",
      "\n",
      "  [[1.38807146]]\n",
      "\n",
      "  [[1.85223477]]\n",
      "\n",
      "  ...\n",
      "\n",
      "  [[1.55724251]]\n",
      "\n",
      "  [[1.60846733]]\n",
      "\n",
      "  [[0.87252248]]]\n",
      "\n",
      "\n",
      " [[[1.54845829]]\n",
      "\n",
      "  [[1.9941312 ]]\n",
      "\n",
      "  [[2.0651464 ]]\n",
      "\n",
      "  ...\n",
      "\n",
      "  [[0.92634314]]\n",
      "\n",
      "  [[0.95181606]]\n",
      "\n",
      "  [[0.79145039]]]\n",
      "\n",
      "\n",
      " ...\n",
      "\n",
      "\n",
      " [[[0.7644128 ]]\n",
      "\n",
      "  [[1.42554603]]\n",
      "\n",
      "  [[1.77052197]]\n",
      "\n",
      "  ...\n",
      "\n",
      "  [[2.15826317]]\n",
      "\n",
      "  [[2.12666   ]]\n",
      "\n",
      "  [[1.16959723]]]\n",
      "\n",
      "\n",
      " [[[1.78911252]]\n",
      "\n",
      "  [[2.1063232 ]]\n",
      "\n",
      "  [[1.97606989]]\n",
      "\n",
      "  ...\n",
      "\n",
      "  [[0.57856862]]\n",
      "\n",
      "  [[1.20764499]]\n",
      "\n",
      "  [[0.845268  ]]]\n",
      "\n",
      "\n",
      " [[[0.8085155 ]]\n",
      "\n",
      "  [[0.9317268 ]]\n",
      "\n",
      "  [[1.38248336]]\n",
      "\n",
      "  ...\n",
      "\n",
      "  [[2.14401701]]\n",
      "\n",
      "  [[1.89609945]]\n",
      "\n",
      "  [[1.36278945]]]]\n"
     ]
    }
   ],
   "source": [
    "sess=tf.Session()\n",
    "with sess.as_default():\n",
    "    print('结果是：', outimg.eval())"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "outputs": [
    {
     "ename": "ValueError",
     "evalue": "Negative dimension size caused by subtracting 3 from 1 for 'convolution_9' (op: 'Conv2D') with input shapes: [32000,100,1,1], [3,3,1,1].",
     "output_type": "error",
     "traceback": [
      "\u001B[1;31m---------------------------------------------------------------------------\u001B[0m",
      "\u001B[1;31mInvalidArgumentError\u001B[0m                      Traceback (most recent call last)",
      "\u001B[1;32mD:\\Anaconda3\\lib\\site-packages\\tensorflow\\python\\framework\\ops.py\u001B[0m in \u001B[0;36m_create_c_op\u001B[1;34m(graph, node_def, inputs, control_inputs)\u001B[0m\n\u001B[0;32m   1658\u001B[0m   \u001B[1;32mtry\u001B[0m\u001B[1;33m:\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[1;32m-> 1659\u001B[1;33m     \u001B[0mc_op\u001B[0m \u001B[1;33m=\u001B[0m \u001B[0mc_api\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0mTF_FinishOperation\u001B[0m\u001B[1;33m(\u001B[0m\u001B[0mop_desc\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0m\u001B[0;32m   1660\u001B[0m   \u001B[1;32mexcept\u001B[0m \u001B[0merrors\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0mInvalidArgumentError\u001B[0m \u001B[1;32mas\u001B[0m \u001B[0me\u001B[0m\u001B[1;33m:\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n",
      "\u001B[1;31mInvalidArgumentError\u001B[0m: Negative dimension size caused by subtracting 3 from 1 for 'convolution_9' (op: 'Conv2D') with input shapes: [32000,100,1,1], [3,3,1,1].",
      "\nDuring handling of the above exception, another exception occurred:\n",
      "\u001B[1;31mValueError\u001B[0m                                Traceback (most recent call last)",
      "\u001B[1;32m<ipython-input-58-a1a4e5f041ed>\u001B[0m in \u001B[0;36m<module>\u001B[1;34m\u001B[0m\n\u001B[1;32m----> 1\u001B[1;33m \u001B[0mout_img4\u001B[0m \u001B[1;33m=\u001B[0m \u001B[0mtf\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0mnn\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0matrous_conv2d\u001B[0m\u001B[1;33m(\u001B[0m\u001B[0mvalue\u001B[0m\u001B[1;33m=\u001B[0m\u001B[0mimgMax\u001B[0m\u001B[1;33m,\u001B[0m \u001B[0mfilters\u001B[0m\u001B[1;33m=\u001B[0m\u001B[0mfilter\u001B[0m\u001B[1;33m,\u001B[0m \u001B[0mrate\u001B[0m\u001B[1;33m=\u001B[0m\u001B[1;36m2\u001B[0m\u001B[1;33m,\u001B[0m \u001B[0mpadding\u001B[0m\u001B[1;33m=\u001B[0m\u001B[1;34m'VALID'\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0m\u001B[0;32m      2\u001B[0m \u001B[0mout_img4\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n",
      "\u001B[1;32mD:\\Anaconda3\\lib\\site-packages\\tensorflow\\python\\ops\\nn_ops.py\u001B[0m in \u001B[0;36matrous_conv2d\u001B[1;34m(value, filters, rate, padding, name)\u001B[0m\n\u001B[0;32m   1371\u001B[0m       \u001B[0mpadding\u001B[0m\u001B[1;33m=\u001B[0m\u001B[0mpadding\u001B[0m\u001B[1;33m,\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0;32m   1372\u001B[0m       \u001B[0mdilation_rate\u001B[0m\u001B[1;33m=\u001B[0m\u001B[0mnp\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0mbroadcast_to\u001B[0m\u001B[1;33m(\u001B[0m\u001B[0mrate\u001B[0m\u001B[1;33m,\u001B[0m \u001B[1;33m(\u001B[0m\u001B[1;36m2\u001B[0m\u001B[1;33m,\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m,\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[1;32m-> 1373\u001B[1;33m       name=name)\n\u001B[0m\u001B[0;32m   1374\u001B[0m \u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0;32m   1375\u001B[0m \u001B[1;33m\u001B[0m\u001B[0m\n",
      "\u001B[1;32mD:\\Anaconda3\\lib\\site-packages\\tensorflow\\python\\ops\\nn_ops.py\u001B[0m in \u001B[0;36mconvolution\u001B[1;34m(input, filter, padding, strides, dilation_rate, name, data_format)\u001B[0m\n\u001B[0;32m    849\u001B[0m         \u001B[0mname\u001B[0m\u001B[1;33m=\u001B[0m\u001B[0mname\u001B[0m\u001B[1;33m,\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0;32m    850\u001B[0m         data_format=data_format)\n\u001B[1;32m--> 851\u001B[1;33m     \u001B[1;32mreturn\u001B[0m \u001B[0mop\u001B[0m\u001B[1;33m(\u001B[0m\u001B[0minput\u001B[0m\u001B[1;33m,\u001B[0m \u001B[0mfilter\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0m\u001B[0;32m    852\u001B[0m \u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0;32m    853\u001B[0m \u001B[1;33m\u001B[0m\u001B[0m\n",
      "\u001B[1;32mD:\\Anaconda3\\lib\\site-packages\\tensorflow\\python\\ops\\nn_ops.py\u001B[0m in \u001B[0;36m__call__\u001B[1;34m(self, inp, filter)\u001B[0m\n\u001B[0;32m    964\u001B[0m \u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0;32m    965\u001B[0m   \u001B[1;32mdef\u001B[0m \u001B[0m__call__\u001B[0m\u001B[1;33m(\u001B[0m\u001B[0mself\u001B[0m\u001B[1;33m,\u001B[0m \u001B[0minp\u001B[0m\u001B[1;33m,\u001B[0m \u001B[0mfilter\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m:\u001B[0m  \u001B[1;31m# pylint: disable=redefined-builtin\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[1;32m--> 966\u001B[1;33m     \u001B[1;32mreturn\u001B[0m \u001B[0mself\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0mconv_op\u001B[0m\u001B[1;33m(\u001B[0m\u001B[0minp\u001B[0m\u001B[1;33m,\u001B[0m \u001B[0mfilter\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0m\u001B[0;32m    967\u001B[0m \u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0;32m    968\u001B[0m \u001B[1;33m\u001B[0m\u001B[0m\n",
      "\u001B[1;32mD:\\Anaconda3\\lib\\site-packages\\tensorflow\\python\\ops\\nn_ops.py\u001B[0m in \u001B[0;36m__call__\u001B[1;34m(self, inp, filter)\u001B[0m\n\u001B[0;32m    589\u001B[0m \u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0;32m    590\u001B[0m   \u001B[1;32mdef\u001B[0m \u001B[0m__call__\u001B[0m\u001B[1;33m(\u001B[0m\u001B[0mself\u001B[0m\u001B[1;33m,\u001B[0m \u001B[0minp\u001B[0m\u001B[1;33m,\u001B[0m \u001B[0mfilter\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m:\u001B[0m  \u001B[1;31m# pylint: disable=redefined-builtin\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[1;32m--> 591\u001B[1;33m     \u001B[1;32mreturn\u001B[0m \u001B[0mself\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0mcall\u001B[0m\u001B[1;33m(\u001B[0m\u001B[0minp\u001B[0m\u001B[1;33m,\u001B[0m \u001B[0mfilter\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0m\u001B[0;32m    592\u001B[0m \u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0;32m    593\u001B[0m \u001B[1;33m\u001B[0m\u001B[0m\n",
      "\u001B[1;32mD:\\Anaconda3\\lib\\site-packages\\tensorflow\\python\\ops\\nn_ops.py\u001B[0m in \u001B[0;36m_with_space_to_batch_call\u001B[1;34m(self, inp, filter)\u001B[0m\n\u001B[0;32m    574\u001B[0m         input=inp, block_shape=dilation_rate, paddings=paddings)\n\u001B[0;32m    575\u001B[0m \u001B[1;33m\u001B[0m\u001B[0m\n\u001B[1;32m--> 576\u001B[1;33m     \u001B[0mresult\u001B[0m \u001B[1;33m=\u001B[0m \u001B[0mself\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0mop\u001B[0m\u001B[1;33m(\u001B[0m\u001B[0minput_converted\u001B[0m\u001B[1;33m,\u001B[0m \u001B[0mfilter\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0m\u001B[0;32m    577\u001B[0m \u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0;32m    578\u001B[0m     result_converted = array_ops.batch_to_space_nd(\n",
      "\u001B[1;32mD:\\Anaconda3\\lib\\site-packages\\tensorflow\\python\\ops\\nn_ops.py\u001B[0m in \u001B[0;36m__call__\u001B[1;34m(self, inp, filter)\u001B[0m\n\u001B[0;32m    206\u001B[0m         \u001B[0mpadding\u001B[0m\u001B[1;33m=\u001B[0m\u001B[0mself\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0mpadding\u001B[0m\u001B[1;33m,\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0;32m    207\u001B[0m         \u001B[0mdata_format\u001B[0m\u001B[1;33m=\u001B[0m\u001B[0mself\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0mdata_format\u001B[0m\u001B[1;33m,\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[1;32m--> 208\u001B[1;33m         name=self.name)\n\u001B[0m\u001B[0;32m    209\u001B[0m \u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0;32m    210\u001B[0m \u001B[1;33m\u001B[0m\u001B[0m\n",
      "\u001B[1;32mD:\\Anaconda3\\lib\\site-packages\\tensorflow\\python\\ops\\gen_nn_ops.py\u001B[0m in \u001B[0;36mconv2d\u001B[1;34m(input, filter, strides, padding, use_cudnn_on_gpu, data_format, dilations, name)\u001B[0m\n\u001B[0;32m   1111\u001B[0m         \u001B[1;34m\"Conv2D\"\u001B[0m\u001B[1;33m,\u001B[0m \u001B[0minput\u001B[0m\u001B[1;33m=\u001B[0m\u001B[0minput\u001B[0m\u001B[1;33m,\u001B[0m \u001B[0mfilter\u001B[0m\u001B[1;33m=\u001B[0m\u001B[0mfilter\u001B[0m\u001B[1;33m,\u001B[0m \u001B[0mstrides\u001B[0m\u001B[1;33m=\u001B[0m\u001B[0mstrides\u001B[0m\u001B[1;33m,\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0;32m   1112\u001B[0m                   \u001B[0mpadding\u001B[0m\u001B[1;33m=\u001B[0m\u001B[0mpadding\u001B[0m\u001B[1;33m,\u001B[0m \u001B[0muse_cudnn_on_gpu\u001B[0m\u001B[1;33m=\u001B[0m\u001B[0muse_cudnn_on_gpu\u001B[0m\u001B[1;33m,\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[1;32m-> 1113\u001B[1;33m                   data_format=data_format, dilations=dilations, name=name)\n\u001B[0m\u001B[0;32m   1114\u001B[0m   \u001B[0m_result\u001B[0m \u001B[1;33m=\u001B[0m \u001B[0m_op\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0moutputs\u001B[0m\u001B[1;33m[\u001B[0m\u001B[1;33m:\u001B[0m\u001B[1;33m]\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0;32m   1115\u001B[0m   \u001B[0m_inputs_flat\u001B[0m \u001B[1;33m=\u001B[0m \u001B[0m_op\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0minputs\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n",
      "\u001B[1;32mD:\\Anaconda3\\lib\\site-packages\\tensorflow\\python\\framework\\op_def_library.py\u001B[0m in \u001B[0;36m_apply_op_helper\u001B[1;34m(self, op_type_name, name, **keywords)\u001B[0m\n\u001B[0;32m    786\u001B[0m         op = g.create_op(op_type_name, inputs, output_types, name=scope,\n\u001B[0;32m    787\u001B[0m                          \u001B[0minput_types\u001B[0m\u001B[1;33m=\u001B[0m\u001B[0minput_types\u001B[0m\u001B[1;33m,\u001B[0m \u001B[0mattrs\u001B[0m\u001B[1;33m=\u001B[0m\u001B[0mattr_protos\u001B[0m\u001B[1;33m,\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[1;32m--> 788\u001B[1;33m                          op_def=op_def)\n\u001B[0m\u001B[0;32m    789\u001B[0m       \u001B[1;32mreturn\u001B[0m \u001B[0moutput_structure\u001B[0m\u001B[1;33m,\u001B[0m \u001B[0mop_def\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0mis_stateful\u001B[0m\u001B[1;33m,\u001B[0m \u001B[0mop\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0;32m    790\u001B[0m \u001B[1;33m\u001B[0m\u001B[0m\n",
      "\u001B[1;32mD:\\Anaconda3\\lib\\site-packages\\tensorflow\\python\\util\\deprecation.py\u001B[0m in \u001B[0;36mnew_func\u001B[1;34m(*args, **kwargs)\u001B[0m\n\u001B[0;32m    505\u001B[0m                 \u001B[1;34m'in a future version'\u001B[0m \u001B[1;32mif\u001B[0m \u001B[0mdate\u001B[0m \u001B[1;32mis\u001B[0m \u001B[1;32mNone\u001B[0m \u001B[1;32melse\u001B[0m \u001B[1;33m(\u001B[0m\u001B[1;34m'after %s'\u001B[0m \u001B[1;33m%\u001B[0m \u001B[0mdate\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m,\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0;32m    506\u001B[0m                 instructions)\n\u001B[1;32m--> 507\u001B[1;33m       \u001B[1;32mreturn\u001B[0m \u001B[0mfunc\u001B[0m\u001B[1;33m(\u001B[0m\u001B[1;33m*\u001B[0m\u001B[0margs\u001B[0m\u001B[1;33m,\u001B[0m \u001B[1;33m**\u001B[0m\u001B[0mkwargs\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0m\u001B[0;32m    508\u001B[0m \u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0;32m    509\u001B[0m     doc = _add_deprecated_arg_notice_to_docstring(\n",
      "\u001B[1;32mD:\\Anaconda3\\lib\\site-packages\\tensorflow\\python\\framework\\ops.py\u001B[0m in \u001B[0;36mcreate_op\u001B[1;34m(***failed resolving arguments***)\u001B[0m\n\u001B[0;32m   3298\u001B[0m           \u001B[0minput_types\u001B[0m\u001B[1;33m=\u001B[0m\u001B[0minput_types\u001B[0m\u001B[1;33m,\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0;32m   3299\u001B[0m           \u001B[0moriginal_op\u001B[0m\u001B[1;33m=\u001B[0m\u001B[0mself\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0m_default_original_op\u001B[0m\u001B[1;33m,\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[1;32m-> 3300\u001B[1;33m           op_def=op_def)\n\u001B[0m\u001B[0;32m   3301\u001B[0m       \u001B[0mself\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0m_create_op_helper\u001B[0m\u001B[1;33m(\u001B[0m\u001B[0mret\u001B[0m\u001B[1;33m,\u001B[0m \u001B[0mcompute_device\u001B[0m\u001B[1;33m=\u001B[0m\u001B[0mcompute_device\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0;32m   3302\u001B[0m     \u001B[1;32mreturn\u001B[0m \u001B[0mret\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n",
      "\u001B[1;32mD:\\Anaconda3\\lib\\site-packages\\tensorflow\\python\\framework\\ops.py\u001B[0m in \u001B[0;36m__init__\u001B[1;34m(self, node_def, g, inputs, output_types, control_inputs, input_types, original_op, op_def)\u001B[0m\n\u001B[0;32m   1821\u001B[0m           op_def, inputs, node_def.attr)\n\u001B[0;32m   1822\u001B[0m       self._c_op = _create_c_op(self._graph, node_def, grouped_inputs,\n\u001B[1;32m-> 1823\u001B[1;33m                                 control_input_ops)\n\u001B[0m\u001B[0;32m   1824\u001B[0m \u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0;32m   1825\u001B[0m     \u001B[1;31m# Initialize self._outputs.\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n",
      "\u001B[1;32mD:\\Anaconda3\\lib\\site-packages\\tensorflow\\python\\framework\\ops.py\u001B[0m in \u001B[0;36m_create_c_op\u001B[1;34m(graph, node_def, inputs, control_inputs)\u001B[0m\n\u001B[0;32m   1660\u001B[0m   \u001B[1;32mexcept\u001B[0m \u001B[0merrors\u001B[0m\u001B[1;33m.\u001B[0m\u001B[0mInvalidArgumentError\u001B[0m \u001B[1;32mas\u001B[0m \u001B[0me\u001B[0m\u001B[1;33m:\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0;32m   1661\u001B[0m     \u001B[1;31m# Convert to ValueError for backwards compatibility.\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[1;32m-> 1662\u001B[1;33m     \u001B[1;32mraise\u001B[0m \u001B[0mValueError\u001B[0m\u001B[1;33m(\u001B[0m\u001B[0mstr\u001B[0m\u001B[1;33m(\u001B[0m\u001B[0me\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m)\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0m\u001B[0;32m   1663\u001B[0m \u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0;32m   1664\u001B[0m   \u001B[1;32mreturn\u001B[0m \u001B[0mc_op\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n",
      "\u001B[1;31mValueError\u001B[0m: Negative dimension size caused by subtracting 3 from 1 for 'convolution_9' (op: 'Conv2D') with input shapes: [32000,100,1,1], [3,3,1,1]."
     ]
    }
   ],
   "source": [
    "out_img4 = tf.nn.atrous_conv2d(value=imgMax, filters=filter, rate=2, padding='VALID')\n",
    "out_img4"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "outputs": [],
   "source": [
    "\n"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}